package Java道题;

import java.util.Scanner;

public class DNA {
	public static boolean include(char s) {
		if(s=='A'||s=='T'||s=='C'||s=='G')
		{
			return true;
		}
		return false;
	}
	public static  void Max(String str) {
		int max=0;
		int tmp=0;
		int length=0;
		str+="z";
		for(int i=0;i<str.length();i++) {

			if(!include(str.charAt(i))&&i!=0){
				length=i-tmp-1;
				tmp=i;
			}
			if(include(str.charAt(i))&&i==0) {
				tmp=-1;
			}
			if(length>max) {
				max=length;
			}
		}
		System.out.println(max);

	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		String ground = null;
		ground=sc.nextLine();
		Max(ground);

	}

}
